﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Helper.Models
{
    public class FeesStatementModel : ModelBase
    {
        ObservableCollection<TransactionModel> _transactions;
        int studentID;
        decimal totalAmt;
        DateTime startDate;
        DateTime endDate;
        public FeesStatementModel()
        {
            Transactions = new ObservableCollection<TransactionModel>();
            StudentID = 0;
            TotalAmt = 0;
            StartDate = DateTime.Now.AddDays(-30);
            EndDate = DateTime.Now;
        }
        public int StudentID
        {
            get
            {
                return studentID;
            }

            set
            {
                if (value != this.studentID)
                {
                    this.studentID = value;
                    NotifyPropertyChanged("StudentID");
                }
            }
        }

        public DateTime StartDate
        {
            get { return startDate; }
            set
            {
                if (value != this.startDate)
                {
                    this.startDate = value;
                    NotifyPropertyChanged("StartDate");
                }
            }
        }

        public DateTime EndDate
        {
            get { return endDate; }
            set
            {
                if (value != this.endDate)
                {
                    this.endDate = value;
                    NotifyPropertyChanged("EndDate");
                }
            }
        }

        public decimal TotalAmt
        {
            get { return totalAmt; }
            set
            {
                if (value != this.totalAmt)
                {
                    this.totalAmt = value;
                    NotifyPropertyChanged("TotalAmt");
                }
            }
        }

        public ObservableCollection<TransactionModel> Transactions
        {
            get { return _transactions; }
            set
            {
                if (value != this._transactions)
                {
                    this._transactions = value;
                    NotifyPropertyChanged("Transactions");
                }
            }
        }

        public override void Reset()
        {
            Transactions = new ObservableCollection<TransactionModel>();
            StudentID = 0;
            TotalAmt = 0;
            StartDate = DateTime.Now.AddDays(-30);
            EndDate = DateTime.Now;
        }
    }

    public class TransactionModel
    {
        public TransactionModel()
        {
            TransactionID = 0;
            TransactionType = TransactionTypes.All;
            DateOfTransaction = DateTime.Now;
            Description = "";
            TransactionAmt = 0;
        }
        public TransactionModel(int transactionID,
            TransactionTypes transactionType, DateTime dateOfTransaction, string description, decimal transactionAmt)
        {
            TransactionID = transactionID;
            TransactionType = transactionType;
            DateOfTransaction = dateOfTransaction;
            Description = description;
            TransactionAmt = transactionAmt;
        }

        public TransactionModel(decimal bbf)
        {
            TransactionID = 0;
            this.TransactionAmt = bbf;
        }


        public TransactionTypes TransactionType
        {
            get;
            set;
        }
        public DateTime DateOfTransaction
        {
            get;
            set;
        }
        public int TransactionID
        {
            get;
            set;
        }
        public string Description
        {
            get;
            set;
        }
        public decimal TransactionAmt
        {
            get;
            set;
        }
    }


}
